package com.doge.walknovel.business.reader.comments

import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.doge.walknovel.api.model.CommentInfo
import com.doge.walknovel.core.base.adapters.BasePagedAdapter

const val COMMENTS_REPLY = "commentsReply"
const val COMMENTS_COLLECT = "commentsCollect"

class ReaderCommentsAdapter : BasePagedAdapter() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
        return when (viewType) {
            ItemType.Comment -> ReaderCommentsViewHolder(parent, callback)
            else -> super.onCreateViewHolder(parent, viewType)
        }
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        val item = getItem(position)
        when (holder) {
            is ReaderCommentsViewHolder -> item?.data<CommentInfo>()?.let { holder.bind(it) }
        }
    }
}
